
#include <iostream>
#include <vector>
#include <algorithm>

#include <boost/foreach.hpp>
#include <boost/thread.hpp>
#include <boost/bind.hpp>

#include <logger.hpp>
#include <xbase_utility.hpp>

using namespace std;

#include <GfsFileSystem.h>

//pthread_key_t CFile::key_;

void list_file(string pdir)
{
	int n = 10;
	while(n--)
	{
		CDirectory dir(pdir.c_str());
		
		for(size_t i=0; i<dir.FileCount(); ++i)
		{
			cout << dir[i].FileName() << endl;
		}
		cout << endl;
		
		CFile file;
		file.Create((pdir + "/a").c_str(), O_RDONLY);
	}
}


int main(int argc, char **argv)
{
	string dir;//(argv[1]);

	while (cin >> dir)
	{
		boost::thread thread(boost::bind(&list_file, dir));
	}
}
